<template>
  <div class="module_container">
    <div class="module_title right"
         flex
    >
      <!-- <div class="tab" flex>
        <div>加分行为</div>
        <div class="active" style="margin-left:-20px">减分行为</div>
      </div> -->
      <div class="title_text">信用等级分布</div>
    </div>
    <div class="content">
      <div class="top" flex="cross:center">
        <div class="circle_box" flex="main:center cross:center">
          <div ref="pie" class="pie" />
          <img src="@/assets/img_xinyong/module6/icon.png">
        </div>
        <div class="legend_box">
          <div flex="main:justify cross:center">
            <div flex="cross:center">
              <!-- <div class="icon" style="background: #46acff" /> -->
              信用大师
            </div>

            <b style="font-size: 32px; color: #46acff">40%</b>
          </div>
          <div flex="main:justify cross:center">
            <div flex="cross:center">
              <!-- <div class="icon" style="background: #b83dff"/> -->
              信用先锋
            </div>
            <b style="font-size: 32px; color:#b83dff">30%</b>
          </div>
          <div flex="main:justify cross:center">
            <div flex="cross:center">
              <!-- <div class="icon" style="background: #ffac2c" /> -->
              信用精英
            </div>
            <b style="font-size: 32px; color: #ffac2c">15%</b>
          </div>
          <div flex="main:justify cross:center">
            <div flex="cross:center">
              <!-- <div class="icon" style="background: #ff2e33" /> -->
              信用标兵
            </div>
            <b style="font-size: 32px; color: #ff2e33">10%</b>
          </div>
          <div flex="main:justify cross:center">
            <div flex="cross:center">
              <!-- <div class="icon" style="background: #ff2e33" /> -->
              信用小白
            </div>
            <b style="font-size: 32px; color: #ff2e33">5%</b>
          </div>
          <!-- <div flex="main:justify cross:center">
            <div flex="cross:center">
              <div class="icon"
                   style="background: #ff2e33"
              />
              信用小白
            </div>
            <b style="font-size: 44px; color: #fff">25.6%</b>
          </div> -->
        </div>
      </div>
      <div class="sub_title">整体平均信用分变化情况</div>
      <div ref="bar"
           class="bar"
      />
    </div>
  </div>
</template>

<script>
import { optionBar1, optionPie } from './module7_option.js'
import Charts from '@jiaminghi/charts'
export default {
  data() {
    return {
      inforData: {}
    }
  },
  created() {
    this.$nextTick(() => {
      new Charts(this.$refs.bar).setOption(optionBar1)
      new Charts(this.$refs.pie).setOption(optionPie)
      // new Charts(this.$refs.line).setOption(optionLine)
    })
  }
}
</script>

<style lang="scss" scoped>
.content {
  // margin-top: 20px;
  // position: relative;
  padding: 25px 40px;
  font-size: 28px;
  .circle_box {
    background: url('~@/assets/img_xinyong/module6/circle_bg.png') no-repeat;
    background-size: 100% 100%;
    width: 240px;
    height: 240px;
    margin-right: 20px;
    position: relative;
    & > .pie {
      width: 380px;
      height: 380px;
      position: absolute;
    }
  }
  .legend_box {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    position: relative;
    flex: 1;
    & > * {
      width: 45%;
      // font-size: 15px;
      line-height: 100px;
      color: #bfdaff;
      .icon {
        height: 20px;
        width: 20px;
        background: olivedrab;
        margin-right: 12px;
      }
    }
  }
  .sub_title {
    margin-top: 20px;
    margin-bottom: 20px;
    background: url('~@/assets/img_xinyong/module6/sub_title_bg.png') no-repeat;
    width: 402px;
    height: 58px;
    line-height: 58px;
    // padding:20px;
    padding-left: 70px;
    font-size: 28px;
  }
  & > .bar {
    width: 100%;
    height: 290px;
    margin-bottom: 15px;
  }
}
</style>
